package com.aididi.utils;

import lombok.Getter;
import lombok.Setter;

/**
 * @author ：xuzexiang
 * @description：
 * @date ： 2021/10/20 15:20
 */
public enum operationTypeEnum {

    TYPE_00("00","反交易权限"),
    S30("S30","退货"),
    ;


    @Getter
    @Setter
    private String value;

    @Getter
    @Setter
    private String desc;

    private operationTypeEnum(String value,String desc){
        this.value = value;
        this.desc = desc;
    }

    public boolean equals(String value){
        return this.value.equals(value);
    }

    public static boolean isContains(String value){
        for(operationTypeEnum enums:operationTypeEnum.values()){
            if(enums.getValue().equals(value)){
                return true;
            }
        }
        return false;
    }

    public static operationTypeEnum getType(String value){
        for(operationTypeEnum enums:operationTypeEnum.values()){
            if(enums.getValue().equals(value)){
                return enums;
            }
        }
        return null;
    }

}
